<template>
<div class="icon" :class="iconType" >
  <i class="icon-item"  :class="itemClasses" ></i>
</div>
</template>

<script type="text/ecmascript-6">
export default{
props:{
  size:{
    type:Number
  },
  icontype:{
    type:Number
  }
},
  computed:{
    iconType() {
      return 'icon-'+this.size;
    },
    itemClasses (){
      let classMap = ['decrease', 'discount', 'guarantee', 'invoice', 'special'];
      switch (this.icontype){
        case 1:return 'decrease';
        case 2:return 'discount';
        case 3:return 'guarantee';
        case 4:return 'invoice';
        case 5:return 'special';
      }
    }
  }
}
</script>

<style>
  .icon,.icon-item{
    display: inline-block;
  }
  .icon-24 .icon-item {
    width: 12px;
    height: 12px;
    background-size:12px 12px;
  }
  .icon-32 .icon-item{

    width: 16px;
    height: 16px;
    background-size:16px 16px;
  }
  .icon-36 .icon-item{

    width: 18px;
    height: 18px;
    background-size:18px 18px;
  }
  .icon-48 .icon-item{
    width: 24px;
    height: 24px;
    background-size:24px 24px;
  }

  .icon-24 .icon-item.decrease{
    background-image: url(decrease_3@2x.png);
  }
  .icon-32 .icon-item.decrease{
    background-image: url(decrease_4@2x.png);
  }
  .icon-36 .icon-item.decrease{
    background-image: url(decrease_3@3x.png);
  }
  .icon-48 .icon-item.decrease{
    background-image: url(decrease_4@3x.png);
  }

  .icon-24 .icon-item.discount{
    background-image: url(discount_3@2x.png);
  }
  .icon-32 .icon-item.discount{
    background-image: url(discount_4@2x.png);
  }
  .icon-36 .icon-item.discount{
    background-image: url(discount_3@3x.png);
  }
  .icon-48 .icon-item.discount{
    background-image: url(discount_4@3x.png);
  }

  .icon-24 .icon-item.guarantee{
    background-image: url(guarantee_3@2x.png);
  }
  .icon-32 .icon-item.guarantee{
    background-image: url(guarantee_4@2x.png);
  }
  .icon-36 .icon-item.guarantee{
    background-image: url(guarantee_3@3x.png);
  }
  .icon-48 .icon-item.guarantee{
    background-image: url(guarantee_4@3x.png);
  }

  .icon-24 .icon-item.invoice{
    background-image: url(invoice_3@2x.png);
  }
  .icon-32 .icon-item.invoice{
    background-image: url(invoice_4@2x.png);
  }
  .icon-36 .icon-item.invoice{
    background-image: url(invoice_3@3x.png);
  }
  .icon-48 .icon-item.invoice{
    background-image: url(invoice_4@3x.png);
  }

  .icon-24 .icon-item.special{
    background-image: url(special_3@2x.png);
  }
  .icon-32 .icon-item.special{
    background-image: url(special_4@2x.png);
  }
  .icon-36 .icon-item.special{
    background-image: url(special_3@3x.png);
  }
  .icon-48 .icon-item.special{
    background-image: url(special_4@3x.png);
  }




</style>
